<template>
  <div class="forgot"></div>
</template>

<script setup>
import useUserStore from "@/store/modules/user.js";
import {useI18n} from "vue-i18n";


const {t} = useI18n();
const {proxy} = getCurrentInstance();
const userStore = useUserStore()
const route = useRoute();
const query = route.query;

import { getToken } from '@/utils/auth'


const token = getToken();

const redirectUri = query?.redirect_uri || undefined;

if (token) {
  userStore.logOut().then(() => {
    gotoPage();
  })
} else {
  gotoPage();
}

function gotoPage(){
  if (redirectUri) {
    //console.log(444,"存在回调地址,进行跳转"+redirectUri)
    location.href = redirectUri;
  } else {
    //console.log(555,"不存在回调地址，直接调整登录页")
    location.href = '/console/login';
  }
}

</script>
